<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('入职列表')"/>
</head>
<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="user-form">
                    <input type="hidden" id="ComPidorDepTid" name="ComPidorDepTid">
                    <div class="select-list">
                        <ul>
                            <li>
                                员工编号：<input type="text" name="Badge"/>
                            </li>
                            <li>
                                姓名：<input type="text" name="Name"/>
                            </li>
                            <li>
                                公司名称：<input type="text" name="compname"/>
                            </li>
                            <li>
                                岗位级别：<select name="jobGradename" th:with="type=${@dict.getType('oCD_jobgrade')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="system:emp:add">
                    <i class="fa fa-plus"></i> 新增
                </a>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" data-mobile-responsive="true"></table>
            </div>
        </div>
    </div>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>

<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('jinpeng:edit')}]];
    var removeFlag = [[${@permission.hasPermi('jinpeng:remove')}]];
    var prefix = ctx + "empentry";

    $(function () {
        var panehHidden = false;
        if ($(this).width() < 800) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 350});
        queryEmpentryInfoList();
    });

    function queryEmpentryInfoList() {
        var options = {
            code: "id",
            uniqueId: "id",
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove/{id}",
            escape: true,
            showPageGo: true,
            rememberSelected: true,
            modalName: "基本信息",
            columns: [{
                checkbox: true
            }, {
                field: 'badge',
                title: '员工编号',
            },
                {
                    field: 'name',
                    title: '姓名'
                },
                {
                    field: 'age',
                    title: '年龄'
                },
                {
                    field: 'gender',
                    title: '性别'
                },
                {
                    field: 'compName',
                    title: '公司名称'
                },
                {
                    field: 'departname',
                    title: '部门名称'
                },
                {
                    field: 'jobName',
                    title: '岗位名称'
                },
                {
                    field: 'reportToName',
                    title: '直接上级'
                },
                {
                    field: 'joinDate',
                    title: '入职日期'
                }]
        };
        $.table.init(options);
    }


    $('#btnExpand').click(function () {
        $._tree.expandAll(true);
        $(this).hide();
        $('#btnCollapse').show();
    });

    $('#btnCollapse').click(function () {
        $._tree.expandAll(false);
        $(this).hide();
        $('#btnExpand').show();
    });

    $('#btnRefresh').click(function () {
        queryDeptTree();
    });
</script>

</body>
</html>